#include <stdint.h>

typedef enum {
  BSP_PWM_TIM2_CH3,
  BSP_PWM_TIM2_CH4,
  BSP_PWM_TIM2_ERROR
} BSP_PWM_Channel_t;

typedef enum { BSP_PWM_Motor_A, BSP_PWM_Motor_B } BSP_PWM_Motor_t;

/**
 * @brief 启动PWM
 *
 * @param channel
 */
void BSP_PWM_Start(BSP_PWM_Channel_t channel);

/**
 * @brief 返回电机对应定时器通道
 *
 * @param motor 电机名
 * @return BSP_PWM_Channel_t
 */
BSP_PWM_Channel_t BSP_PWM_GetChannelHandle(BSP_PWM_Motor_t motor);

/**
 * @brief 更改占空比
 *
 * @param channel 通道
 * @param value 值
 */
void BSP_PWM_SetCompare(BSP_PWM_Channel_t channel, uint32_t value);
